package com.felix.headFirst.behavior.entity;

import com.felix.headFirst.behavior.FlyBehavior;
import com.felix.headFirst.behavior.QuackBehavior;

public abstract class Duck {

   FlyBehavior flyBehavior;
   QuackBehavior quackBehavior;

   void performQuack(){
       quackBehavior.quack();
   }
   void performFly(){
       flyBehavior.fly();
   }

   abstract void display();

   void swim(){
       System.out.println("All ducks float, even decoys");
   }

    public void setFlyBehavior(FlyBehavior flyBehavior) {
        this.flyBehavior = flyBehavior;
    }

    public void setQuackBehavior(QuackBehavior quackBehavior) {
        this.quackBehavior = quackBehavior;
    }
}
